#define _CRT_SECURE_NO_WARNINGS 1
int* findErrorNums(int* nums, int numsSize, int* returnSize) {
    *returnSize = 2;
    int* arr = (int*)calloc(numsSize + 1, sizeof(int));
    int* ret = (int*)calloc(*returnSize, sizeof(int));
    int cur = 0;
    int old = 0;
    for (int i = 0; i < numsSize; i++)
    {
        if (arr[nums[i]] == 1)
        {
            ret[0] = nums[i];
        }
        arr[nums[i]] = 1;
        old += i + 1;
        cur += nums[i];
    }
    ret[1] = old - (cur - ret[0]);
    free(arr);
    return ret;
}